<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/Function Info.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>WinXDraw_SetImageChannel</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<style type="text/css">
<!--
.style3 {font-size: medium}
-->
</style>

<link href="../../WinXStyles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
	font-size: x-large;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style2 {
	font-size: large;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
-->
</style>
</head>

<body>
<h1 class="style1"><img src="../../WinX48.png" width="48" height="48" align="absmiddle"> <!-- InstanceBeginEditable name="title" -->WinXDraw_SetImageChannel<!-- InstanceEndEditable --></h1>
<hr>

<!-- InstanceBeginEditable name="Prototype" -->
<p>WinXDraw_SetImageChannel (hImage, channel, UBYTE @data[])</p>
<!-- InstanceEndEditable --><!-- InstanceBeginEditable name="Description" -->
<p>Sets the image channel data for an image channel </p>
<!-- InstanceEndEditable -->
<table width="80%" border="1" cellpadding="0" cellspacing="0">
  <tr bgcolor="#CCCCCC">
    <th width="24%"><span class="style3">Parameter</span></th>
    <th width="76%"><span class="style3">Description</span></th>
  </tr>
  <!-- InstanceBeginRepeat name="Parameter Table" --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->hImage<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The handle to the image to set the channel for <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->channel<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The channel id, see remarks for more info <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->UBYTE @data[] <!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The channel data. The function fails if this array is too small <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceEndRepeat -->
</table>
<h3>Returns</h3>
<!-- InstanceBeginEditable name="Return Info" -->
<p>$$TRUE on success or $$FALSE on fail </p>
<!-- InstanceEndEditable -->
<h3>Remarks</h3>
<!-- InstanceBeginEditable name="Remarks" -->
<p>The channel parameter can be any one of :</p>
<dl>
  <dt>$$CHANNEL_RED</dt>
  <dd>The red channel</dd>
  <dt>$$CHANNEL_GREEN</dt>
  <dd>The green channel</dd>
  <dt>$$CHANNEL_BLUE</dt>
  <dd>The blue channel</dd>
  <dt>$$CHANNEL_ALPHA</dt>
  <dd>The alpha (transparency) channel</dd>
</dl>
<p>Note that the data[] array is single dimensional, in row order, and with the last scanline at the top of the array. This orgainisation is a little wierd. It is to do with the way Windows stores and renders bitmaps.</p>
<!-- InstanceEndEditable -->
<h3>Examples</h3>
<table width="80%"  border="0">
  <tr>
    <td bgcolor="#C6C6FF"><!-- InstanceBeginEditable name="Example Code" -->
      <p class="codeStyle">'Declare the data array<br>
        UBYTE data[]</p>
      <p class="codeStyle">... </p>
      <p class="codeStyle">'Set the red channel to 0 for a 400x300 bitmap<br>
        DIM data[400*300-1]<br>
      WinXDraw_SetImageChannel (hImage, $$CHANNEL_RED, @data[])      </p>
      <!-- InstanceEndEditable --></td>
  </tr>
</table>

<h2 class="style2">Related Links</h2>
<!-- InstanceBeginEditable name="Related Links" -->
<p><a href="../../WinX%20Programmer%27s%20Guide/Auto%20Draw.htm/Images.htm">Images</a><br>
  <a href="../Auto%20Draw.htm/WinXDrawImage.htm">WinXDrawImage<br>
  </a><a href="WinXDraw_CreateImage.htm">WinXDraw_CreateImage</a><br>
  <a href="WinXDraw_LoadImage.htm">WinXDraw_LoadImage</a><br>
  <a href="WinXDraw_SaveImage.htm">WinXDraw_SaveImage</a><br>
  <a href="WinXDraw_SetImagePixel.htm">WinXDraw_SetImagePixel</a><br>
  <a href="WinXDraw_SetConstantAlpha.htm">WinXDraw_SetConstantAlpha</a><br>
  <a href="WinXDraw_GetImageInfo.htm">WinXDraw_GetImageInfo</a><br>
<a href="WinXDraw_PremultiplyImage.htm">WinXDraw_PremultiplyImage</a></p>
<!-- InstanceEndEditable -->
</body>
<!-- InstanceEnd --></html>
